#include "LightningGun.h"
#include "../../CreateLightPrimBullet.h"
#include "../../../SGD_Wrappers/IMessage.h"
#include "../../../SGD_Wrappers/CSGD_MessageSystem.h"
#include "../../../SGD_Wrappers/CSGD_EventSystem.h"


CLightningGun::CLightningGun(void)
{
	m_fCooldownShot1=2.0f;
	m_fCooldownShot2=2.0f;
	m_nEnergyCostShot1=20;
	m_nEnergyCostShot2=40;
}


CLightningGun::~CLightningGun(void)
{
}

void CLightningGun::Shoot()
{

	if(Owner->GetEnergy() >= m_nEnergyCostShot1)
	{
		CSGD_EventSystem* pES = CSGD_EventSystem::GetInstance();
		pES->SendEvent("DRAIN_ENERGY",(void*)m_nEnergyCostShot1,nullptr,this);

		IMessage* i = new CreateLightPrimBullet( Owner );
		CSGD_MessageSystem::GetInstance()->SendMsg( i );
		i = nullptr;
	}

}
void CLightningGun::Render()
{

}

void CLightningGun::Update(float fElapsedTime)
{

}
void CLightningGun::AddRef()
{

}
void CLightningGun::Update()
{

}
RECT CLightningGun::GetRect()
{
	return CEntity::GetRect();
}

void CLightningGun::HandleEvent(CEvent* pEvent)
{

}


CPlayer*	CLightningGun::GetOwner( void )
{
	return Owner;
}

void		CLightningGun::SetOwner( CPlayer* p )
{
	Owner = p;
}